<?php
require_once 'functions.php';
if(empty($_POST['id'])){
    die('id is empty');
}
if(empty($_POST['username'])){
    die('name is empty');
}
if(empty($_POST['email'])){
    die('email is empty');
} 
$id=$_POST['id'];
$name=$_POST['username'];
$email=$_POST['email'];
// $eamil=intval($_POST['eamil']);
 
 
//连接数据库
connnetDb();
 
 
//修改指定数据
mysql_query("UPDATE usertext SET  username='$name',email='$email' WHERE id=$id");
 
 
//排错并返回
if(mysql_error()){
    echo mysql_error();
}else{
    header("Location:allusers.php");
}
